(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

last(nil) → 0
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0, 0) → true
eq(0, s(y)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Rewrite Strategy: FULL

(1) DecreasingLoopProof (EQUIVALENT transformation)

The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
last(cons(x, cons(y, xs))) →+ last(cons(y, xs))
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [xs / cons(y, xs)].
The result substitution is [x / y].

(2) BOUNDS(n^1, INF)

(3) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(4) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

S is empty.
Rewrite Strategy: FULL

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

(7) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
last, del, eq, reverse

They will be analysed ascendingly in the following order:
last < reverse
eq < del
del < reverse

(8) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
last, del, eq, reverse

They will be analysed ascendingly in the following order:
last < reverse
eq < del
del < reverse

(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Induction Base:
last(gen_nil:cons5_0(+(1, 0))) →RΩ(1)
0'

Induction Step:
last(gen_nil:cons5_0(+(1, +(n7_0, 1)))) →RΩ(1)
last(cons(0', gen_nil:cons5_0(n7_0))) →IH
gen_0':s4_0(0)

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(10) Complex Obligation (BEST)

(11) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
eq, del, reverse

They will be analysed ascendingly in the following order:
eq < del
del < reverse

(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)

Induction Base:
eq(gen_0':s4_0(0), gen_0':s4_0(0)) →RΩ(1)
true

Induction Step:
eq(gen_0':s4_0(+(n335_0, 1)), gen_0':s4_0(+(n335_0, 1))) →RΩ(1)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) →IH
true

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(13) Complex Obligation (BEST)

(14) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
del, reverse

They will be analysed ascendingly in the following order:
del < reverse

(15) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol del.

(16) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
reverse

(17) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
reverse(gen_nil:cons5_0(n914_0)) → gen_nil:cons5_0(n914_0), rt ∈ Ω(1 + n9140 + n91402)

Induction Base:
reverse(gen_nil:cons5_0(0)) →RΩ(1)
nil

Induction Step:
reverse(gen_nil:cons5_0(+(n914_0, 1))) →RΩ(1)
cons(last(cons(0', gen_nil:cons5_0(n914_0))), reverse(del(last(cons(0', gen_nil:cons5_0(n914_0))), cons(0', gen_nil:cons5_0(n914_0))))) →LΩ(1 + n9140)
cons(gen_0':s4_0(0), reverse(del(last(cons(0', gen_nil:cons5_0(n914_0))), cons(0', gen_nil:cons5_0(n914_0))))) →LΩ(1 + n9140)
cons(gen_0':s4_0(0), reverse(del(gen_0':s4_0(0), cons(0', gen_nil:cons5_0(n914_0))))) →RΩ(1)
cons(gen_0':s4_0(0), reverse(if(eq(gen_0':s4_0(0), 0'), gen_0':s4_0(0), 0', gen_nil:cons5_0(n914_0)))) →LΩ(1)
cons(gen_0':s4_0(0), reverse(if(true, gen_0':s4_0(0), 0', gen_nil:cons5_0(n914_0)))) →RΩ(1)
cons(gen_0':s4_0(0), reverse(gen_nil:cons5_0(n914_0))) →IH
cons(gen_0':s4_0(0), gen_nil:cons5_0(c915_0))

We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).

(18) Complex Obligation (BEST)

(19) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)
reverse(gen_nil:cons5_0(n914_0)) → gen_nil:cons5_0(n914_0), rt ∈ Ω(1 + n9140 + n91402)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(20) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n2) was proven with the following lemma:
reverse(gen_nil:cons5_0(n914_0)) → gen_nil:cons5_0(n914_0), rt ∈ Ω(1 + n9140 + n91402)

(21) BOUNDS(n^2, INF)

(22) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)
reverse(gen_nil:cons5_0(n914_0)) → gen_nil:cons5_0(n914_0), rt ∈ Ω(1 + n9140 + n91402)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(23) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n2) was proven with the following lemma:
reverse(gen_nil:cons5_0(n914_0)) → gen_nil:cons5_0(n914_0), rt ∈ Ω(1 + n9140 + n91402)

(24) BOUNDS(n^2, INF)

(25) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n335_0), gen_0':s4_0(n335_0)) → true, rt ∈ Ω(1 + n3350)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(26) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

(27) BOUNDS(n^1, INF)

(28) Obligation:

TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(29) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

(30) BOUNDS(n^1, INF)